package com.lr;
import java.io.*;

public class ListDir {
	public static void main(String args[]){
		File f = new File("F:/A");
		tree(f,0);
		
	}
	
	private static  void tree(File f,int n){
		String preStr = "";
		for(int i=0 ; i<n ; i++){
			preStr+="  ";
		}
		
		File[] f1 = f.listFiles();
		for(int i=0 ; i<f1.length ; i++){
			System.out.println(preStr+f1[i].getName());
			if(f1[i].isDirectory()){
				tree(f1[i],n+1);
			}
		}
	}
}
